<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>display-table-centering</title>
    <style>
        .container {
            width: 250px;
            height: 250px;
            border: 1px solid #9c27bd;
        }
        .center {
            width: 100%;
            height: 100%;
            display: table;
        }
        .center > span {
            display: table-cell;
            text-align: center;
            vertical-align: middle;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="center">
            <span>Centered content</span>
        </div>
    </div>
</body>
</html>